package com.liarjo.my_website_api.admin.controller.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.liarjo.my_website_api.admin.controller.user.page.AdminUserPageRequest;
import com.liarjo.my_website_api.admin.controller.user.page.AdminUserPageResult;

@RestController
@RequestMapping("/api/admin/user")
public class AdminUserController {
    @Autowired
    private AdminUserService userService;

    @GetMapping("/page")
    @PreAuthorize("hasAuthority('admin:user:page')")
    public IPage<AdminUserPageResult> page(AdminUserPageRequest userPageRequest) {
        return userService.page(userPageRequest);
    }
}
